package com.zyf.pattern.singleton.lazy;

/**
 * 懒汉式
 * 在外部需要使用的时候才进行实例化
 * create by yifeng
 */
public class LazyOne {
    private LazyOne() {
    }
    private static LazyOne lazy = null;

    public static LazyOne getInstance() {
        if (lazy == null) {
            lazy = new LazyOne();
        }
        return lazy;
    }
}
